<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
                             "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:s="http://jboss.com/products/seam/taglib"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:rich="http://richfaces.org/rich"
                template="layout/template.xhtml">
                       
<ui:define name="body">
    
    <h:messages globalOnly="true" styleClass="message" id="globalMessages"/>
    
    <rich:panel>
        <f:facet name="header">KreditniZahtev</f:facet>

        <s:decorate id="korisnik" template="layout/display.xhtml">
            <ui:define name="label">Korisnik</ui:define>
         	#{kreditniZahtevHome.instance.korisnik.ime} #{kreditniZahtevHome.instance.korisnik.prezime}, #{kreditniZahtevHome.instance.korisnik.jmbg}          
        </s:decorate>

        <s:decorate id="brojZahteva" template="layout/display.xhtml">
            <ui:define name="label">Broj zahteva</ui:define>
            <h:outputText value="#{kreditniZahtevHome.instance.brojZahteva}">
                <f:convertNumber/>
            </h:outputText>
        </s:decorate>

        <s:decorate id="datumZahteva" template="layout/display.xhtml">
            <ui:define name="label">Datum zahteva</ui:define>
            #{kreditniZahtevHome.instance.datumZahteva}
        </s:decorate>

        <s:decorate id="iznos" template="layout/display.xhtml">
            <ui:define name="label">Iznos kredita</ui:define>
            <h:outputText value="#{kreditniZahtevHome.instance.iznos}">
                <f:convertNumber/>
            </h:outputText>
        </s:decorate>
        
        <s:decorate id="valuta" template="layout/display.xhtml">
            <ui:define name="label">Valuta</ui:define>
         	#{kreditniZahtevHome.instance.valuta.oznaka}          
        </s:decorate>

        <s:decorate id="iznosRate" template="layout/display.xhtml">
            <ui:define name="label">Iznos rate</ui:define>
            <h:outputText value="#{kreditniZahtevHome.instance.iznosRate}">
                <f:convertNumber/>
            </h:outputText>
        </s:decorate>

        <s:decorate id="iznosUcesca" template="layout/display.xhtml">
            <ui:define name="label">Iznos ucesca</ui:define>
            <h:outputText value="#{kreditniZahtevHome.instance.iznosUcesca}">
                <f:convertNumber/>
            </h:outputText>
        </s:decorate>

        <s:decorate id="rok" template="layout/display.xhtml">
            <ui:define name="label">Rok otplate</ui:define>
            <h:outputText value="#{kreditniZahtevHome.instance.rok}">
                <f:convertNumber/>
            </h:outputText>
        </s:decorate>
  
         <s:decorate id="tipRocnosti" template="layout/display.xhtml">
            <ui:define name="label">Tip rocnosti</ui:define>
         	#{kreditniZahtevHome.instance.tipRocnosti.naziv}          
        </s:decorate>      
        
         <s:decorate id="namena" template="layout/display.xhtml">
            <ui:define name="label">Namena kredita</ui:define>
         	#{kreditniZahtevHome.instance.namena.naziv}          
        </s:decorate>                    

        <div style="clear:both"/>
        
    </rich:panel>
    
    <div class="actionButtons">  
        <s:button view="/KreditniZahtevEdit.xhtml" 
                    id="edit" 
                 value="Izmeni"/>
        <s:button view="/#{empty kreditniZahtevFrom ? 'KreditniZahtevList' : kreditniZahtevFrom}.xhtml"
                    id="done"
                 value="Nazad"/>
    </div>


    <div class="association" id="statusParent">
        
        <h:outputText value="Kreditni zahtev nema nikakav status. Postoji greska." 
                   rendered="#{kreditniZahtevHome.instance.status == null}"/>
        
        <rich:dataTable var="status" 
                   value="#{kreditniZahtevHome.instance.status}" 
                rendered="#{kreditniZahtevHome.instance.status != null}"
              rowClasses="rvgRowOne,rvgRowTwo"
                      id="statusTable">

            <h:column>
                <f:facet name="header">Statusi zahteva za kredit</f:facet>
                #{status.naziv}
            </h:column>
            
        </rich:dataTable>
        
    </div>




</ui:define>

</ui:composition>
